package com.xx.douyi.controller;

import com.xx.douyi.annotation.RepeatSubmit;
import com.xx.douyi.service.BossZPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Description: com.xx.douyi.controller
 * @Author: ruby
 * @CreateTime: 2023-02-13 17:32
 */
@RestController
@RequestMapping("/boss")
public class BossZPController {
    @Autowired
    BossZPService bossZPService;
    @GetMapping("/msg")
    @RepeatSubmit
    public Map getMsg(@RequestParam(value = "time",required = false) String time, @CookieValue(required = false) String cookies){
        Thread thread = new Thread(() -> System.out.println("你好"));
        thread.start();
        if(cookies == null||cookies.equals("")){
            cookies = "wd_guid=9acfc537-5a4b-4283-91b9-c1b8b5c5e0a7; historyState=state; warlockjssdkcross=%7B%22distinct_id%22%3A%22104650313%22%2C%22first_id%22%3A%2218243ffd7d91b0-0085269576834a-76492e29-1821369-18243ffd7da3cb%22%2C%22props%22%3A%7B%7D%2C%22device_id%22%3A%2218243ffd7d91b0-0085269576834a-76492e29-1821369-18243ffd7da3cb%22%7D; lastCity=101210100; _bl_uid=mnlLL9g6chF8p9j5qaOjdhRoz0ya; wbg=0; collection_pop_window=1; wt2=DaqCVWe58Kc6VQ0wrK-rlZe-L-UrOU7eA9l0oYt8-RGapaPzKvbFVM-v8hnUrxi7eFNzeTs_fz8lJ44YiB7ojPA~~; __g=-; __l=l=%2Fwww.zhipin.com%2Fhangzhou%2F&r=&g=&s=3&friend_source=0; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1676355510,1676443330,1676480210,1676526727; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1676527792; __zp_stoken__=297ceYT1UYlADEmlaIwdmORkRUzcTeD8icwN1Wi1MejITbnM3P31qKlMoT2hGUQI6JjtlZwk9Bi8GNl0fLxcwZCR1anEIFBgMOVw%2BUBkZeBxjXCFdRztFDAB8N00HPjBxZAJXBntDC01LBgc%3D; __c=1676526727; __a=88871435.1610090325.1676480210.1676526727.322.27.9.297; geek_zp_token=V1QNojF-H92V9pVtRvyBsdKyK26jnfwys~";
        }
        return bossZPService.getMsg(time,cookies);
    }
}
